<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test01</title>
</head>
<body>
<script type="text/javascript">
    class Person {
        static foo = 'bar';

        constructor(name, age) {
            this.name = name;
            this.age = age;
            // this.sayName = this.sayName.bind(this);
        }

        // sayName() {
        //     console.log(this.name);
        // }

        sayName = () => console.log(this.name);

        static sayFoo() {
            // console.log(Person.foo);
            console.log(this.foo);
        }
    }

    class Action {
        shout() {
            console.log(this.name + ":" + this.age);
        }

        run() {
            console.log("Run!");
        }

        jump() {
            console.log("Jump!");
        }
    }

    class Student extends Person {
        constructor(name, age, school) {
            super(name, age);
            this.school = school;
        }
    }

    Student.prototype.shout = Action.prototype.shout;
    Student.prototype.run = Action.prototype.run;
    Student.prototype.jump = Action.prototype.jump;

    console.dir(Action.prototype);

    let stu01 = new Student("zhangsan", 18, "abc school");

    stu01.sayName();

    stu01.shout();
    stu01.run();
    stu01.jump();

</script>
</body>
</html>